﻿/**
 * Created in 2012-2-16.
 */
package kit4j.tests.jdk.math;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

/**
 * 
 * @author MiniKnife
 *
 */
public class TestBigDecimalRound {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		testRound(new BigDecimal("242342.12534566"));
	}
	
	static void testRound(BigDecimal num) {
		System.out.println(num.setScale(2, RoundingMode.HALF_UP));
		System.out.println(num.round(new MathContext(10, RoundingMode.HALF_UP)));
	}

}
